# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pythreatgrid2
pkgname=('python2-pythreatgrid2' 'python-pythreatgrid2')
_pkgname=pythreatgrid2
pkgver=5.3521e34
pkgrel=7
pkgdesc='Python library to request crt.sh certificate information.'
arch=('any')
url='https://pypi.org/project/pythreatgrid2/#files'
license=('APACHE')
makedepends=('git' 'python2-setuptools' 'python-setuptools')
source=("git+https://github.com/Te-k/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cp -a "$_pkgname"{,-2}
}

build() {
  cd "$_pkgname-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname"

  python setup.py build
}

package_python2-pythreatgrid2() {
  depends=('python2' 'python2-requests')

  cd "$_pkgname-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

}

package_python-pythreatgrid2() {
  depends=('python' 'python-requests')

  cd $_pkgname

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

